package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SoilPhysicsMapper;
import com.ruoyi.system.domain.SoilPhysics;
import com.ruoyi.system.service.ISoilPhysicsService;
import com.ruoyi.common.core.text.Convert;

/**
 * 物理性质Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-20
 */
@Service
public class SoilPhysicsServiceImpl implements ISoilPhysicsService 
{
    @Autowired
    private SoilPhysicsMapper soilPhysicsMapper;

    /**
     * 查询物理性质
     * 
     * @param id 物理性质主键
     * @return 物理性质
     */
    @Override
    public SoilPhysics selectSoilPhysicsById(Long id)
    {
        return soilPhysicsMapper.selectSoilPhysicsById(id);
    }

    /**
     * 查询物理性质列表
     * 
     * @param soilPhysics 物理性质
     * @return 物理性质
     */
    @Override
    public List<SoilPhysics> selectSoilPhysicsList(SoilPhysics soilPhysics)
    {
        return soilPhysicsMapper.selectSoilPhysicsList(soilPhysics);
    }

    /**
     * 新增物理性质
     * 
     * @param soilPhysics 物理性质
     * @return 结果
     */
    @Override
    public int insertSoilPhysics(SoilPhysics soilPhysics)
    {
        soilPhysics.setCreateTime(DateUtils.getNowDate());
        return soilPhysicsMapper.insertSoilPhysics(soilPhysics);
    }

    /**
     * 修改物理性质
     * 
     * @param soilPhysics 物理性质
     * @return 结果
     */
    @Override
    public int updateSoilPhysics(SoilPhysics soilPhysics)
    {
        soilPhysics.setUpdateTime(DateUtils.getNowDate());
        return soilPhysicsMapper.updateSoilPhysics(soilPhysics);
    }

    /**
     * 批量删除物理性质
     * 
     * @param ids 需要删除的物理性质主键
     * @return 结果
     */
    @Override
    public int deleteSoilPhysicsByIds(String ids)
    {
        return soilPhysicsMapper.deleteSoilPhysicsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除物理性质信息
     * 
     * @param id 物理性质主键
     * @return 结果
     */
    @Override
    public int deleteSoilPhysicsById(Long id)
    {
        return soilPhysicsMapper.deleteSoilPhysicsById(id);
    }
}
